package cn.udrm.water.base.v1.frontpages.ac;

import org.springframework.stereotype.Component;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestParam;

import cn.udrm.water.base.v1.commons.annotations.Router;

/**
 * 权限控制首页路由
 * @author liukang
 * @date 2019年3月22日
 */
@Component
@Router(value="router/ac")
public class AcIndexRouter {
	
	@Router(value="index")
	public String index() {
		return "ac/acindex";
	}
	
	@Router(value="defaultPage")
	public String defaultPage() {
		return "ac/defaultPage";
	}
	
	@Router(value="resourceDetail")
	public String resourceDetail(@RequestParam(value="id") String id, ModelMap modelMap) {
		modelMap.addAttribute("id", id);
		return "ac/resource/resourceDetail";
	}
	
	@Router(value="resourceAdd")
	public String resourceAdd(@RequestParam(value="parentId", required=false) String parentId, @RequestParam(value="id", required=false) String id,
			ModelMap modelMap) {
		modelMap.addAttribute("id", id);
		modelMap.addAttribute("parentId", parentId);
		return "ac/resource/resourceAdd";
	}
	
	@Router(value="resourceAuthorize")
	public String resourceAuthorize(@RequestParam(value="id") String id, ModelMap modelMap) {
		modelMap.addAttribute("id", id);
		return "ac/resource/resourceAuthorize";
	}

}
